<div id="list-product" class="content scaffold-list" role="main">
		<g:if test="${flash.message}">
		<div class="message" role="status">${flash.message}</div>
		</g:if>
		<table>
			<thead>
				<tr>
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="productCode" 
						title="${message(code: 'product.productCode.label', default: 'Product Code')}" style="width: 50px" update="list-product"/>
				
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="productName" 
						title="${message(code: 'product.productName.label', default: 'product Name')}" style="width: 70px" update="list-product"/>
						
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="productSpec" 
						title="${message(code: 'product.productSpec.label', default: 'product spec')}" update="list-product"/>
					
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="unit" 
						title="${message(code: 'product.unit.label', default: 'unit')}" update="list-product" style="width: 30px"/>
						
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="productPackage" 
						title="${message(code: 'product.productPackage.label', default: 'productPackage')}" style="width: 50px" update="list-product"/>
					
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="stockNum" 
						title="${message(code: 'product.stockNum.label', default: 'stock Num')}" update="list-product"/>
						
					<util:remoteSortableColumn controller="product" action="listByType" params="[productTypeId: params.productTypeId]" property="price" 
						title="${message(code: 'product.price.label', default: 'price')}" style="width: 50px" update="list-product"/>
					<th>
						${message(code: 'product.productDes.label', default: 'Product Des')}
					</th>
						
				</tr>
			</thead>
			<tbody>
			<g:if	test="${null!= productInstanceList && productInstanceList.size()>0}">
				<g:each in="${productInstanceList}" status="i" var="productInstance">
				<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
				
					<td><g:link action="view" id="${productInstance.id}">${fieldValue(bean: productInstance, field: "productCode")}</g:link></td>
					<td>${fieldValue(bean: productInstance, field: "productName")}</td>
					<td>${fieldValue(bean: productInstance, field: "productSpec")}</td>
					<td>${fieldValue(bean: productInstance, field: "unit")}</td>
					<td>${fieldValue(bean: productInstance, field: "productPackage")}</td>
					<td>${fieldValue(bean: productInstance, field: "stockNum")}</td>
					<td>${fieldValue(bean: productInstance, field: "price")}</td>
					<td>${fieldValue(bean: productInstance, field: "productDes")}</td>
				</tr>
			</g:each>
			</g:if>
			</tbody>
		</table>
		<div class="pagination">
			<g:if test="${null!= productInstanceList && productInstanceList.size()>0}">
				<g:if test="${productInstanceTotal>0}">
	            	 <util:remotePaginate controller="product" action="listByType" params="[productTypeId: params.productTypeId]" total="${productInstanceTotal}"
	                                   update="list-product" max="10" pageSizes="[10, 20, 50,100]"/>
	        	</g:if>
	        </g:if>
	         <g:else>
	        	<span>there is no data</span>
	        </g:else>
		</div>
	</div>


